<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>12-v-text与v-html的使用</title>
</head>
<body>
  <div id="app">
    <h1>vue的例子</h1>
    <p>{{msg}}</p>
    <hr>
    <p>{{link}}</p>
    <p v-text="link"></p>
    <p v-html="link"></p>
  </div>
  <script src="../js/vue.js"></script>
  <script>
    Vue.config.productionTip = false; // 关闭生产提示
    const vm = new Vue({
      el: '#app',
      data: {
        msg: 'hello',
        link:'<a href="http://www.baidu.com">百度</a>'
      }
    })

    // v-text  就相当于原生JSDom中的innerText
    // v-html 就相当于是原生Dom中的innerHTML
  </script>
</body>
</html>